package com.td.library.utils;

import ohos.app.Context;
import ohos.data.distributed.common.KvManagerConfig;
import ohos.data.distributed.common.KvManagerFactory;
import ohos.data.distributed.device.DeviceInfo;

/**
 * 设备操作工具类
 */
public class DeviceUtils {
    private static final String TAG = "DeviceUtils";

    /**
     * 获取本地设备信息
     *
     * @param context 上下文
     * @return 设备信息
     */
    public static DeviceInfo getLocalDeviceInfo(Context context) {
        DeviceInfo deviceInfo = KvManagerFactory.getInstance().createKvManager(new KvManagerConfig(context))
                .getLocalDeviceInfo();
        LogUtil.info(TAG, "deviceInfo " + deviceInfo);
        return deviceInfo;
    }
}
